static void
gdk_broadway_cairo_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkBroadwayCairoContext *self = GDK_BROADWAY_CAIRO_CONTEXT (draw_context);
static void
gdk_broadway_draw_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkBroadwayDrawContext *self = GDK_BROADWAY_DRAW_CONTEXT (draw_context);
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings", TRUE },
- { "hdr", GDK_DEBUG_HDR, "Use HDR rendering if possible", TRUE },
+ { "high-depth", GDK_DEBUG_HIGH_DEPTH, "Use high bit depth rendering if possible", TRUE },
};
GDK_DEBUG_VULKAN_DISABLE = 1 << 21,
GDK_DEBUG_VULKAN_VALIDATE = 1 << 22,
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 23,
- GDK_DEBUG_HDR = 1 << 24,
+ GDK_DEBUG_HIGH_DEPTH = 1 << 24,
} GdkDebugFlags;
extern guint _gdk_debug_flags;
#ifdef HAVE_EGL
EGLDisplay egl_display;
EGLConfig egl_config;
- EGLConfig egl_config_hdr;
+ EGLConfig egl_config_high_depth;
#endif
guint rgba : 1;
}
gpointer
-gdk_display_get_egl_config_hdr (GdkDisplay *self)
+gdk_display_get_egl_config_high_depth (GdkDisplay *self)
{
GdkDisplayPrivate *priv = gdk_display_get_instance_private (self);
- return priv->egl_config_hdr;
+ return priv->egl_config_high_depth;
}
static EGLDisplay
epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_pixel_format_float");
if (self->have_egl_no_config_context)
- priv->egl_config_hdr = gdk_display_create_egl_config (self,
+ priv->egl_config_high_depth = gdk_display_create_egl_config (self,
GDK_EGL_CONFIG_HDR,
error);
- if (priv->egl_config_hdr == NULL)
- priv->egl_config_hdr = priv->egl_config;
+ if (priv->egl_config_high_depth == NULL)
+ priv->egl_config_high_depth = priv->egl_config;
GDK_DISPLAY_NOTE (self, OPENGL, {
char *ext = describe_extensions (priv->egl_display);
- char *sdr_cfg = describe_egl_config (priv->egl_display, priv->egl_config);
- char *hdr_cfg = describe_egl_config (priv->egl_display, priv->egl_config_hdr);
+ char *std_cfg = describe_egl_config (priv->egl_display, priv->egl_config);
+ char *hd_cfg = describe_egl_config (priv->egl_display, priv->egl_config_high_depth);
g_message ("EGL API version %d.%d found\n"
" - Vendor: %s\n"
" - Version: %s\n"
" - Extensions:\n"
"\t%s\n"
" - Selected fbconfig: %s\n"
- " HDR fbconfig: %s",
+ " high depth: %s",
major, minor,
eglQueryString (priv->egl_display, EGL_VENDOR),
eglQueryString (priv->egl_display, EGL_VERSION),
eglQueryString (priv->egl_display, EGL_CLIENT_APIS),
- ext, sdr_cfg,
- priv->egl_config_hdr == priv->egl_config ? "none" : hdr_cfg);
- g_free (hdr_cfg);
- g_free (sdr_cfg);
+ ext, std_cfg,
+ priv->egl_config_high_depth == priv->egl_config ? "none" : hd_cfg);
+ g_free (hd_cfg);
+ g_free (std_cfg);
g_free (ext);
});
GError **error);
gpointer gdk_display_get_egl_display (GdkDisplay *display);
gpointer gdk_display_get_egl_config (GdkDisplay *display);
-gpointer gdk_display_get_egl_config_hdr (GdkDisplay *display);
+gpointer gdk_display_get_egl_config_high_depth
+ (GdkDisplay *display);
void gdk_display_set_rgba (GdkDisplay *display,
gboolean rgba);
}
/*
- * @request_hdr: %TRUE to request high dynamic range.
+ * @prefers_high_depth: %TRUE to request a higher bit depth
*
- * If HDR is requested, GDK will see about providing a rendering target
- * that supports high dynamic range. Typically this means a target supporting
- * 16bit floating point pixels, but that is not guaranteed.
+ * If high depth is preferred, GDK will see about providing a rendering target
+ * that supports higher bit depth than 8 bits per channel. Typically this means
+ * a target supporting 16bit floating point pixels, but that is not guaranteed.
*
* This is only a request and if the GDK backend does not support HDR rendering
* or does not consider it worthwhile, it may choose to not honor the request.
- * It may also choose to provide HDR even if it was not requested.
+ * It may also choose to provide high depth even if it was not requested.
* Typically the steps undertaken by a backend are:
- * 1. Check if HDR is supported by this drawing backend.
- * 2. Check if the compositor supports HDR.
- * 3. Check if the compositor prefers SDR. This is usually the case when the attached
- * monitors do not support HDR content or when the system is resource constrained.
+ * 1. Check if high depth is supported by this drawing backend.
+ * 2. Check if the compositor supports high depth.
+ * 3. Check if the compositor prefers regular bit depth. This is usually the case
+ * when the attached monitors do not support high depth content or when the
+ * system is resource constrained.
* In either of those cases, the context will usually choose to not honor the request.
*
- * The rendering code must be able to deal with HDR and SDR content, no matter if HDR
- * was requested. The request is only a hint and GDK is free to choose.
+ * The rendering code must be able to deal with content in any bit depth, no matter
+ * the preference. The prefers_high_depth argument is only a hint and GDK is free
+ * to choose.
*/
void
gdk_draw_context_begin_frame_full (GdkDrawContext *context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
const cairo_region_t *region)
{
GdkDrawContextPrivate *priv = gdk_draw_context_get_instance_private (context);
return;
}
- if (GDK_DISPLAY_DEBUG_CHECK (priv->display, HDR))
- request_hdr = TRUE;
+ if (GDK_DISPLAY_DEBUG_CHECK (priv->display, HIGH_DEPTH))
+ prefers_high_depth = TRUE;
priv->frame_region = cairo_region_copy (region);
priv->surface->paint_context = g_object_ref (context);
- GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, request_hdr, priv->frame_region);
+ GDK_DRAW_CONTEXT_GET_CLASS (context)->begin_frame (context, prefers_high_depth, priv->frame_region);
}
#ifdef HAVE_SYSPROF
GObjectClass parent_class;
void (* begin_frame) (GdkDrawContext *context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *update_area);
void (* end_frame) (GdkDrawContext *context,
cairo_region_t *painted);
void gdk_draw_context_surface_resized (GdkDrawContext *context);
void gdk_draw_context_begin_frame_full (GdkDrawContext *context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
const cairo_region_t *region);
G_END_DECLS
static void
gdk_gl_context_real_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkGLContext *context = GDK_GL_CONTEXT (draw_context);
#ifdef HAVE_EGL
if (priv->egl_context)
- gdk_surface_ensure_egl_surface (surface, request_hdr);
+ gdk_surface_ensure_egl_surface (surface, prefers_high_depth);
#endif
damage = GDK_GL_CONTEXT_GET_CLASS (context)->get_damage (context);
gpointer egl_native_window;
#ifdef HAVE_EGL
EGLSurface egl_surface;
- gboolean egl_surface_hdr;
+ gboolean egl_surface_high_depth;
#endif
gpointer widget;
void
gdk_surface_ensure_egl_surface (GdkSurface *self,
- gboolean hdr)
+ gboolean high_depth)
{
GdkSurfacePrivate *priv = gdk_surface_get_instance_private (self);
GdkDisplay *display = gdk_surface_get_display (self);
g_return_if_fail (priv->egl_native_window != NULL);
- if (priv->egl_surface_hdr != hdr &&
+ if (priv->egl_surface_high_depth != high_depth &&
priv->egl_surface != NULL &&
- gdk_display_get_egl_config_hdr (display) != gdk_display_get_egl_config (display))
+ gdk_display_get_egl_config_high_depth (display) != gdk_display_get_egl_config (display))
{
eglDestroySurface (gdk_surface_get_display (self), priv->egl_surface);
priv->egl_surface = NULL;
if (priv->egl_surface == NULL)
{
priv->egl_surface = eglCreateWindowSurface (gdk_display_get_egl_display (display),
- hdr ? gdk_display_get_egl_config_hdr (display)
- : gdk_display_get_egl_config (display),
+ high_depth ? gdk_display_get_egl_config_high_depth (display)
+ : gdk_display_get_egl_config (display),
(EGLNativeWindowType) priv->egl_native_window,
NULL);
- priv->egl_surface_hdr = hdr;
+ priv->egl_surface_high_depth = high_depth;
}
#endif
}
static void
gdk_vulkan_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkVulkanContext *context = GDK_VULKAN_CONTEXT (draw_context);
static void
_gdk_macos_cairo_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkMacosCairoContext *self = (GdkMacosCairoContext *)draw_context;
static void
gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *painted)
{
GdkMacosGLContext *self = (GdkMacosGLContext *)context;
[self->gl_context update];
}
- GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->begin_frame (context, request_hdr, painted);
+ GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->begin_frame (context, prefers_high_depth, painted);
if (!self->is_attached)
{
static void
gdk_wayland_cairo_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkWaylandCairoContext *self = GDK_WAYLAND_CAIRO_CONTEXT (draw_context);
static void
gdk_wayland_gl_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
gdk_wayland_surface_ensure_wl_egl_window (gdk_draw_context_get_surface (draw_context));
- GDK_DRAW_CONTEXT_CLASS (gdk_wayland_gl_context_parent_class)->begin_frame (draw_context, request_hdr, region);
+ GDK_DRAW_CONTEXT_CLASS (gdk_wayland_gl_context_parent_class)->begin_frame (draw_context, prefers_high_depth, region);
glDrawBuffers (1, (GLenum[1]) { GL_BACK });
}
static void
gdk_win32_cairo_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkWin32CairoContext *self = GDK_WIN32_CAIRO_CONTEXT (draw_context);
static void
gdk_win32_gl_context_egl_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *update_area)
{
gdk_win32_surface_handle_queued_move_resize (draw_context);
- GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, request_hdr, update_area);
+ GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_egl_parent_class)->begin_frame (draw_context, prefers_high_depth, update_area);
}
static void
static void
gdk_win32_gl_context_wgl_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *update_area)
{
gdk_win32_surface_handle_queued_move_resize (draw_context);
- GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, request_hdr, update_area);
+ GDK_DRAW_CONTEXT_CLASS (gdk_win32_gl_context_wgl_parent_class)->begin_frame (draw_context, prefers_high_depth, update_area);
}
static int
static void
gdk_win32_vulkan_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *update_area)
{
gdk_win32_surface_handle_queued_move_resize (draw_context);
- GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, request_hdr, update_area);
+ GDK_DRAW_CONTEXT_CLASS (gdk_win32_vulkan_context_parent_class)->begin_frame (draw_context, prefers_high_depth, update_area);
}
static void
static void
gdk_x11_cairo_context_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
GdkX11CairoContext *self = GDK_X11_CAIRO_CONTEXT (draw_context);
static void
gdk_x11_gl_context_egl_begin_frame (GdkDrawContext *draw_context,
- gboolean request_hdr,
+ gboolean prefers_high_depth,
cairo_region_t *region)
{
- GDK_DRAW_CONTEXT_CLASS (gdk_x11_gl_context_egl_parent_class)->begin_frame (draw_context, request_hdr, region);
+ GDK_DRAW_CONTEXT_CLASS (gdk_x11_gl_context_egl_parent_class)->begin_frame (draw_context, prefers_high_depth, region);
glDrawBuffers (1, (GLenum[1]) { GL_BACK });
}